 <link href="<?php echo $this->getSkinUrl('Customerpartner/colorpicker/css/colorpicker.css'); ?>" rel="stylesheet" />
<script type="text/javascript">
if (typeof jQuery == 'undefined'){
    document.write(unescape("%3Cscript src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>
<script src="<?php echo $this->getSkinUrl('Customerpartner/colorpicker/js/colorpicker.js'); ?>"></script>
<script src="<?php echo $this->getSkinUrl('Customerpartner/js/nicEdit-latest.js'); ?>" type="text/javascript"></script>
<script type="text/javascript">

//<![CDATA[
  bkLib.onDomLoaded(function() { 
        new nicEditor({fullPanel : true}).panelInstance('compdesi');
		new nicEditor({fullPanel:true}).panelInstance('compdesihtml');   
  });
  //]]>
</script>
<style>
	.input-box{display:inline-block;}
	.group-select input,.group-select select,
	.group-select textarea{
		background-color: #FFFFFF;
		border: 1px solid #CCCCCC;
		box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
		transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;
		border-radius: 4px 4px 4px 4px;
		color: #555555;
		display: inline-block;
		font-size: 14px;
		height: 20px;
		line-height: 20px;
		margin-bottom: 10px;
		padding: 4px 6px;
		vertical-align: top;
	}
	.group-select input[type="file"]{width:200px;}
	.field{margin-top:10px;}
	.input-box{font-weight:600;width:400px;}
	.group-select textarea{height: 100px;}
	.group-select select{height: 28px;}
	.group-select input.input-text:focus,.group-select textarea:focus,.group-select button:hover{
		border-color: rgba(82, 168, 236, 0.8);
		box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82, 168, 236, 0.6);
		outline: 0 none;
	}
	.input-box .companyids{text-decoration: none;width: 170px;}
	label{
		display: inline-block;
		font-size: 13px;
		font-weight: 600;
		vertical-align: top;
		width: 180px;
	}
	fieldset{
		background-color: #F5F5F5;
		border: 1px solid #E3E3E3;
		border-radius: 4px 4px 4px 4px;
		box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05) inset;
		margin-bottom: 20px;
		min-height: 20px;
		padding: 19px;
	}
	.group-select button{
		-moz-border-bottom-colors: none;
		-moz-border-left-colors: none;
		-moz-border-right-colors: none;
		-moz-border-top-colors: none;
		background-color: #F5F5F5;
		background-image: linear-gradient(to bottom, #FFFFFF, #E6E6E6);
		background-repeat: repeat-x;
		border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) #A2A2A2;
		border-image: none;
		border-radius: 4px 4px 4px 4px;
		border-style: solid;
		border-width: 1px;
		box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05);
		color: #333333;
		cursor: pointer;
		display: inline-block;
		font-size: 14px;
		line-height: 20px;
		margin-bottom: 0;
		padding: 4px 12px;
		text-align: center;
		text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
		vertical-align: middle;
		float:right;
	}

	h4.legend{
		border-bottom: 1px solid #777777;
		color: #777777;
		letter-spacing: 1px;
		margin-bottom: 15px;
		padding-bottom: 5px;
	}
	#shortprofile{
		left: 184px;
		overflow: auto;
		position: relative;
		top: -20px;
		width: 385px;
	}
	td[align="center"]{text-align:center;}
	fieldset.group-select div.field div.input-box div{border-radius:0px 0px 4px 4px;} 
	fieldset.group-select div.field div.input-box div.nicEdit-panelContain{border-radius:4px 4px 0px 0px;}
	.input-box .prev-img{position: relative;right: -100px;width:120px;}
	.color-pick{
		border: 3px solid #CCCCCC;
		border-radius: 5px;
		display: inline-block;
		height: 27px;
		width: 30px;
		cursor: pointer;
	}
	.country-img-prev{margin-left: 50px;vertical-align: middle;width: 30px;}
	.btn-primary {
		background-image: linear-gradient(to bottom, #FFFFFF, #E6E6E6);
		border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) #A2A2A2;
		border-radius: 4px 4px 4px 4px;
		border-width: 1px;
		box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05);
		color: #333333;
		display: inline-block;
		line-height: 20px;
		padding: 4px 12px;
		text-align: center;
		vertical-align: middle;
		background-color: #006DCC;
		background-image: linear-gradient(to bottom, #0088CC, #0044CC);
		background-repeat: repeat-x;
		border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
		color: #FFFFFF;
		text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
		text-decoration:none;
		width:170px;
		opacity:0.8;	
	}
	.btn-primary:hover{opacity:1;}
	.len{width:375px;}
</style>
<div class="page-head">
    <h3><?php echo Mage::helper('marketplacepartner')->__('Edit Account Information') ?></h3>
</div>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<form action="<?php echo $this->getUrl('customer/account/editPost') ?>" method="post" id="form-validate">
<fieldset class="group-select">
    <?php echo $this->getBlockHtml('formkey')?>
    <h4 class="legend"><?php echo Mage::helper('marketplacepartner')->__('Account Information') ?></h4>
    <ul>
        <li>
            <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getCustomer())->toHtml() ?></li>
        <li>
            <div class="input-box">
           <label for="email"><span class="required">*</span><?php echo Mage::helper('marketplacepartner')->__('Partner Email Address') ?> </label>
            <input type="text" name="email" id="email" value="<?php echo $this->htmlEscape($this->getCustomer()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="required-entry validate-email input-text" />
            </div>
        </li>

<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
<?php if ($_dob->isEnabled()): ?>
        <li><?php echo $_dob->setDate($this->getCustomer()->getDob())->toHtml() ?></li>
<?php endif ?>
<?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
<?php if ($_taxvat->isEnabled()): ?>
        <li><?php echo $_taxvat->setTaxvat($this->getCustomer()->getTaxvat())->toHtml() ?></li>
<?php endif ?>
    </ul>
	
	<p><input type="checkbox" name="change_password" id="change_password" value="1" onclick="setPasswordForm(this.checked)" title="<?php echo Mage::helper('marketplacepartner')->__('Change Password') ?>"<?php if($this->getCustomer()->getChangePassword()==1): ?> checked="checked"<?php endif; ?> /> <label for="change_password"><?php echo Mage::helper('marketplacepartner')->__('Change Password') ?></label>
	</p>
	<fieldset class="group-select" style="display:none">
	    <h4 class="legend"><?php echo Mage::helper('marketplacepartner')->__('Change Password') ?></h4>
	    <ul>
	        <li>
	            <div class="input-box">
	                <label for="current_password"><?php echo Mage::helper('marketplacepartner')->__('Current Password') ?></label>
	                <input type="password" class="input-text" name="current_password" id="current_password" />
	            </div>
	        </li>
	        <li>
	            <div class="input-box">
	                <label for="password"><?php echo Mage::helper('marketplacepartner')->__('New Password') ?></label>
	                <input type="password" class="validate-password input-text" name="password" id="password" />
	            </div>
	            <div class="input-box">
	                <label for="confirmation"><?php echo Mage::helper('marketplacepartner')->__('Confirm New Password') ?></label>
	                <input type="password" class="validate-cpassword input-text" name="confirmation" id="confirmation" />
	            </div>
	        </li>
	    </ul>
	</fieldset>
	<div class="button-set" style="margin:0">
		<p class="required">*<?php echo Mage::helper('marketplacepartner')->__('Required Fields') ?></p>
	    <button type="submit" class="form-button"><span><?php echo Mage::helper('marketplacepartner')->__('Save Account Information') ?></span></button>
	</div>
</fieldset>
</form>

<form action="<?php echo $this->getUrl('customer/account/editProfile') ?>" enctype="multipart/form-data" method="post" id="form-validate">
<fieldset class="group-select">
    <?php echo $this->getBlockHtml('formkey')?>
    <h4 class="legend"><?php echo Mage::helper('marketplacepartner')->__('Profile') ?></h4>
    <table width="100%">
    	<tr>
    		<td>
				<ul>
			        <li>
			            <div class="input-box">
			            <label for="nickname"><?php echo Mage::helper('marketplacepartner')->__('Screen name') ?></label>
			            <input type="text" name="nickname" id="nickname" value="<?php echo $this->htmlEscape($this->getCustomer()->getNickname()) ?>" title="<?php echo Mage::helper('marketplacepartner')->__('Screen name') ?>" class="input-text" />
			            </div>
			        </li>
			        <li>
			            <div class="input-box">
			            <label for="shortprofile"><?php echo Mage::helper('marketplacepartner')->__('Short profile') ?></label>
						<textarea name="shortprofile" id="shortprofile" style="width:375px; overflow: auto;" cols="1" rows="3"  ><?php echo $this->htmlEscape($this->getCustomer()->getShortprofile()) ?></textarea>
			            </div>
			        </li>
			        <!--li>
			            <div class="input-box">
			            <!-- <h4>File Upload</h4> -->
			            <!--label for="file"><?php //echo Mage::helper('marketplacepartner')->__('Avatar') ?></label>
			            <input type="file" name="avatar" style="height:25px;" size="33"><br clear="all"/>
			            </div>
			        </li-->
			    </ul>
    		</td>
    		<!--td width="40%" align="center">
    			<?php //echo $this->getAvatar($this->getCustomer()->getId()); ?>
    		</td-->
    	<tr>
    </table>
	<?php 
	$partner=Mage::getModel('marketplaceprofile/marketplaceprofile')->getPartnerProfileById($this->getCustomer()->getId());
	if($partner['wantpartner']==1){?> 
	<div class="field">
			<label for="twitterid" class="required"><?php echo Mage::helper('marketplacepartner')->__('Twitter ID') ?> </label>
			<div class="input-box">
				 <input type="text" id="twitterid" name="twitterid" value="<?php echo $partner['twitterid']; ?>" title="twitterid" class="input-text required-entry" />
			</div>
		</div>
		<div class="field">
			<label for="facebookid" class="required"><?php echo Mage::helper('marketplacepartner')->__('Facebook ID') ?> </label>
			<div class="input-box">
				 <input type="text" id="facebookid" name="facebookid" value="<?php echo $partner['facebookid']; ?>" title="facebookid" class="input-text required-entry" />
			</div>
		</div>
		<div class="field">
			<label for="backgroundth" class="required"><?php echo Mage::helper('marketplacepartner')->__('Theme : Background Color') ?> </label>
			<div class="input-box">
				 <input type="text" id="backgroundth" name="backgroundth" value="<?php echo $partner['backgroundth']; ?>" title="backgroundth" class="input-text required-entry" />
				 <span class="color-pick" style="background-color:<?php echo $partner['backgroundth']; ?>"></span>
			</div>
		</div>
		<div class="field">
			<label for="bannerpic" class="required"> <?php echo Mage::helper('marketplacepartner')->__('Company Banner') ?> </label>
			<div class="input-box">
				 <input type="file" id="bannerpic" name="bannerpic"  title="bannerpic" class="input-text required-entry" style="height:25px" size="26" />
				 <img class="prev-img" alt=" <?php echo Mage::helper('marketplacepartner')->__('no image') ?>" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'avatar/'.$partner['bannerpic']; ?>"/>
			</div>
		</div>
		
		<div class="field">
			<label for="logopic" class="required"> <?php echo Mage::helper('marketplacepartner')->__('Company Logo') ?> </label>
			<div class="input-box">
				 <input type="file" id="logopic" alt="no image" name="logopic"  title="logopic" class="input-text required-entry" style="height:25px" size="26"/>
				 <img class="prev-img" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'avatar/'.$partner['logopic']; ?>"/>
			</div>
		</div>
		<div class="field">
			<label for="complocality" class="required"><?php echo Mage::helper('marketplacepartner')->__('Company Locality') ?></label>
			<div class="input-box">
				 <input type="text" id="complocality" name="complocality" value="<?php echo $partner['complocality']; ?>" title="complocality" class="input-text required-entry" />
			</div>
		</div>
		<div class="field">
			<label for="compname" class="required"><?php echo Mage::helper('marketplacepartner')->__('Company Name') ?></label>
			<div class="input-box">
				 <input type="text" id="compname" name="compname" value="<?php echo $partner['compname']; ?>" title="compname" class="input-text required-entry" /> 
			</div>
		</div>
		<div class="field">
			<label for="compdesi" class="required"><?php echo Mage::helper('marketplacepartner')->__('Company Description') ?></label>
			<div class="input-box">
				 <textarea style="width:375px; overflow: auto;" type="text" id="compdesi" name="compdesi" title="compdesi" class="input-text required-entry" ><?php echo $partner['compdesi']; ?> </textarea>
			</div>
		</div>
		<div class="field">
			<label for="countrypic" class="required"> <?php echo Mage::helper('marketplacepartner')->__('Country Logo') ?> </label>
			<div class="input-box">
				 <input type="file" id="countrypic" name="countrypic"  title="countrypic" class="input-text required-entry" style="height:25px" />
			     <img class="country-img-prev" alt="no image" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'avatar/'. $partner['countrypic']; ?>"/>
			</div>
		</div>
		<div class="field">
			<label for="compdesihtml" class="required"><?php echo Mage::helper('marketplacepartner')->__('Description in HTML') ?></label>
			<div class="input-box"> 
				 <textarea style="width:375px; overflow: auto;" type="text" id="compdesihtml" name="compdesihtml" title="compdesihtml" class="input-text required-entry" ><?php echo $partner['compdesihtml']; ?> </textarea>
			</div>
		</div>
		<div class="field">
			<label for="compdesihtml" class="required"><?php echo Mage::helper('marketplacepartner')->__('Company Profile View') ?></label>
			<div class="input-box">
				<a class="btn-primary" id="cprofile" href="<?php echo $this->getUrl('marketplacepartner/'); ?>profile?id=<?php echo Mage::getSingleton('customer/session')->getCustomer()->getId(); ?>" target="_blank"><?php echo Mage::helper('marketplacepartner')->__('Click for profile view') ?></a>
			</div>
		</div>
		<div class="field">
			<label for="compdesihtml" class="required"><?php echo Mage::helper('marketplacepartner')->__('Company Store View') ?></label>
			<div class="input-box">
				<a class="btn-primary" id="cstore" href="<?php echo $this->getUrl('marketplacepartner/'); ?>store?id=<?php echo Mage::getSingleton('customer/session')->getCustomer()->getId(); ?>" target="_blank"><?php echo Mage::helper('marketplacepartner')->__('Click for store view') ?></a>
			</div>
		</div>
		<div class="field">
			<label for="compdesihtml" class="required"><?php echo Mage::helper('marketplacepartner')->__('Company Collection View') ?></label>
			<div class="input-box">
				<a class="btn-primary" id="ccollection" href="<?php echo $this->getUrl('marketplacepartner/'); ?>collection?id=<?php echo Mage::getSingleton('customer/session')->getCustomer()->getId(); ?>" target="_blank"><?php echo Mage::helper('marketplacepartner')->__('Click for collection view') ?></a>
			</div>
		</div>
	<?php } ?>
	<div class="button-set" style="margin:0">
	    <button type="submit" class="form-button"><span><?php echo Mage::helper('marketplacepartner')->__('Save Profile') ?></span></button>
	</div>
</fieldset>
</form>

<?php 
	$paymentDetail=Mage::getModel('marketplaceprofile/paymentdetail')->getPartnerPaymentDetailById($this->getCustomer()->getId());
?>
<form action="<?php echo $this->getUrl('customer/account/payment') ?>" enctype="multipart/form-data" method="post" id="form-validate">
	<fieldset class="group-select">
		<?php echo $this->getBlockHtml('formkey')?>
		<h4 class="legend"><?php echo Mage::helper('marketplacepartner')->__('Payment Mode') ?></h4>
		<ul>
			<li>
				<div class="input-box">
				<label for="paymentsource"><?php echo Mage::helper('marketplacepartner')->__('Payment Details') ?></label>
				<textarea name="paymentsource" id="paymentsource" title="payment source" cols="1" rows="3" style="width:375px; overflow: auto;" ><?php echo $paymentDetail ?></textarea>
				</div>
			</li>
			<li>
				<div class="input-box">
				<input type="hidden" name="userid" id="userid" value="<?php echo Mage::getSingleton('customer/session')->getCustomer()->getId(); ?>" title="userid" class="input-text"  />
				</div>
			</li>
		</ul>		
		<div class="button-set" style="margin:0">
			<button type="submit" class="form-button"><span><?php echo Mage::helper('marketplacepartner')->__('Save Payment') ?></span></button>
		</div>
	</fieldset>
</form>
<a href="<?php echo $this->getBackUrl() ?>" class="left">&laquo; <?php echo Mage::helper('marketplacepartner')->__('Back') ?></a>
<script type="text/javascript">
//<![CDATA[
    var dataForm = new VarienForm('form-validate', true);
    function setPasswordForm(arg){
        if(arg){
            $('current_password').up(3).show();
            $('current_password').addClassName('required-entry');
            $('password').addClassName('required-entry');
            $('confirmation').addClassName('required-entry');

        }else{
            $('current_password').up(3).hide();
            $('current_password').removeClassName('required-entry');
            $('password').removeClassName('required-entry');
            $('confirmation').removeClassName('required-entry');
        }
    }
    <?php if($this->getCustomer()->getChangePassword()): ?>
        setPasswordForm(true);
    <?php endif; ?>
//]]>
</script>
<script>
(function($wk_jq){
	$wk_jq(function(){
		$wk_jq('.color-pick').ColorPicker({
			color: '<?php echo $partner['backgroundth']; ?>',
			onShow: function (colpkr) {
				$wk_jq(colpkr).fadeIn(500);
				return false;
			},
			onHide: function (colpkr) {
				$wk_jq(colpkr).fadeOut(500);
				return false;
			},
			onChange: function (hsb, hex, rgb) {
				$wk_jq('#backgroundth').val('#' + hex);
				$wk_jq('.color-pick').css('background-color','#'+hex);
			}
		});
	});
})(jQuery);
</script>
